package com.zp.self.module.level_5_设计模式.行为型模式.Ⅷ_迭代器模式;

/**
 * @author ：by Zeng Peng
 * @date ：Created 2022/7/6 7:48
 * @description ：
 */
public class Client {
    public static void main(String[] args) {
        MyLinkedList<Student> myLinkedList = new MyLinkedList<>();
        myLinkedList.add(new Student("独孤求败没有钱",20));
        myLinkedList.add(new Student("西门吹雪没女友",21));
        myLinkedList.add(new Student("窃格瓦拉没电瓶",27));
        System.out.println(myLinkedList.remove( new Student("窃格瓦拉没电瓶",27)));

        Iterator<Student> iterator = myLinkedList.getIterater();
        while (iterator.haveNext()){
            Object next = iterator.next();
            System.out.println(next);
        }
    }
}
